<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="test" tagdir="/WEB-INF/tags/test"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>    
<title>test</title>
</head>
<body>
<%
    String xx = request.getParameter("xx");
    if(xx == null)xx = "中国";
    out.println("xx="+xx);
    out.println("xx1="+new String(xx.getBytes("ISO-8859-1"),"UTF-8"));
    out.println("xx2="+new String(xx.getBytes("ISO-8859-1"),"gb2312"));
    out.println("xx3="+new String(xx.getBytes("UTF-8"),"gb2312"));
    out.println("xxx="+java.net.URLDecoder.decode(xx,"ISO-8859-1"));
    String yy = java.net.URLDecoder.decode(xx,"UTF-8");
    out.println("yy="+yy);
    String yyy = java.net.URLDecoder.decode(xx);
    out.println("yyyy="+yyy);
    String kkk = java.net.URLEncoder.encode("好","UTF-8");
    out.println("kkk="+kkk);
    out.println("jjj="+java.net.URLDecoder.decode(kkk,"UTF-8"));
    
    
String[] encodings={"iso8859_1","gb2312","utf-8","windows-1252","GBK"};
String encoding="";
    String name = request.getParameter("name");
    out.println("<br>");
    out.println("name="+name);

try
{
    for(int i=0;i<encodings.length;i++)
    {
        if(name.equals(new String(name.getBytes(),encodings[i])))
        out.println(encodings[i]);
    }
}
catch(Exception e){}
    
%>
post:
<html:form action="/testup">
    <html:hidden property="action" value="3"/>
    <html:text property="name"/><br>
    <html:submit/>
</html:form>
<hr>
get:
<html:form action="/testup" method="get">
    <html:hidden property="action" value="3"/>
    <html:text property="name"/><br>
    <html:submit/>
</html:form>
<c:if test="${user_session.type == null}">
</c:if>
1.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="1"/>
    <html:file property="file"/><br>
    <html:submit/>
</html:form>
<hr>
2.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="2"/>
    <html:file property="file"/><br>
    <html:submit/>
</html:form>
<hr>
3.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="3"/>
    <html:file property="file"/><br>
    <html:text property="name"/><br>
    <html:submit/>
</html:form>
4.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="4"/>
    <html:file property="file"/><br>
    <html:text property="name"/><br>
    <html:submit/>
</html:form>
5.
<html:form action="/testup">
    <html:hidden property="action" value="5"/>
    <html:text property="name"/><br>
    <html:submit/>
</html:form>
</body>
</html>
6.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="6"/>
    <html:file property="file"/><br>
    <html:text property="name"/><br>
    <html:submit/>
</html:form>
7.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="7"/>
    <html:file property="file"/><br>
    <html:text property="name"/><br>
    <html:submit/>
</html:form>
8.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="8"/>
    <html:file property="file"/><br>
    <html:submit/>
</html:form>
9.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="9"/>
    <html:file property="file"/><br>
    <html:submit/>
</html:form>
10.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="10"/>
    <html:file property="file"/><br>
    <html:submit/>
</html:form>
11.
<html:form action="/testup" enctype="multipart/form-data">
    <html:hidden property="action" value="11"/>
    <html:file property="file"/><br>
    <html:submit/>
</html:form>

<!--
all requests values in url or get form are in UTF-8
all values in post form decided by <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-->
<!--
java.version:<%=System.getProperty("java.version")%><br>
java.home:<%=System.getProperty("java.home")%><br>
os.name:<%=System.getProperty("os.name")%><br>
os.arch:<%=System.getProperty("os.arch")%><br>
os.version:<%=System.getProperty("os.version")%><br>
-->
<script type="text/javascript"><!--
google_ad_client = "pub-3370373040606812";
/* MR_Blog 120x600, by William 08-8-29 */
google_ad_slot = "9630595635";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br>
<br>
<script type="text/javascript"><!--
google_ad_client = "pub-3370373040606812";
/* MR_Blog_Pic 250x250, by William 08-8-29 */
google_ad_slot = "1792359457";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


<test:test id="1">
sadsaas${param.a}
</test:test>
